package com.example.lambda.collection;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
    public static void main(String[] args) {
        // 从 From 2022-07-08 00:00:00至 To 2024-06-30 00:00:00  
        Pattern pattern = Pattern.compile("(\\d{4}-\\d{2}-\\d{2}.\\d{2}:\\d{2}:\\d{2})");


        String reg = "2\\s*00&";
        String str = "从 From 2022-07-08 00:00:00至 To 2024-06-30 00:00:00 ";

        Matcher matcher = pattern.matcher(str);
//        while (matcher.find()){
//            System.out.println(matcher.group());
//        }
        matcher.find();
        System.out.println(matcher.group());
        matcher.find();
        System.out.println(matcher.group());
    }
}
